#include<iostream>

using namespace std;

int main()
{
	int a, b, c, i = 1, max = 0;
	cin >> a >> b >> c;
	while (i <= a && i <= b && i <= c)
	{
		if (a % i == b % i && b % i == c % i)	max = i;
		i++;
	}
	cout << max << endl;
	return 0;
}
